package com.mxpio.erp.equipment.service.impl;

import com.mxpio.erp.common.equipment.entity.EquipmentCheckDetailParam;
import com.mxpio.erp.common.equipment.service.EquipmentCheckDetailParamService;
import com.mxpioframework.jpa.JpaUtil;
import com.mxpioframework.jpa.query.Criteria;
import com.mxpioframework.jpa.query.Operator;
import com.mxpioframework.system.service.impl.BaseServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Description: 点检明细选项
 * @Author: MxpIO
 * @Date:   2021-09-15
 * @Version: V1.0
 */
@Service
public class EquipmentCheckDetailParamServiceImpl extends BaseServiceImpl<EquipmentCheckDetailParam> implements EquipmentCheckDetailParamService {


    @Override
    public void deleteByMainId(String mainId) {
        JpaUtil.lind(EquipmentCheckDetailParam.class).equal("detailId", mainId).delete();
    }


    @Override
    public void deleteByMainIds(List<String> mainIds) {
        JpaUtil.lind(EquipmentCheckDetailParam.class).in("detailId", mainIds).delete();

    }

    @Override
    public List<EquipmentCheckDetailParam> selectByMainId(String mainId) {
        Criteria c = Criteria.create().addCriterion("detailId", Operator.EQ, mainId);
        List<EquipmentCheckDetailParam> list = list(EquipmentCheckDetailParam.class, c);
        return list;
    }
}
